/*
 * 	JenSoft SW2D Charting Framework
 * 
 *	http://www.jensoft.org
 *	
 *	Copyright (c) 2008-2011 JenSoft. All rights reserved.
 *  This software is the proprietary of JenSoft.
 *  
 *  JenSoft Software License Agreement:
 *  If you are unsure which license is appropriate for your use, 
 *  please contact the JenSoft at http://www.jensoft.org
 *
 */

/**
 * @author Bent Juergensen
 * 
 */
package de.nordakademie.wpk.share.ui.view.chartview;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Font;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.UIManager;

import com.jensoft.sw2d.core.democomponent.ComandBar;
import com.jensoft.sw2d.core.democomponent.ComandGroup;
import com.jensoft.sw2d.core.democomponent.ImageResource;

public class ViewFrame extends JFrame {

	private static final long serialVersionUID = 156889765687899L;

	private JTextArea area;


	public void show(Graph2d graph2d, String shareName) {
		try {

			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (Exception e) {
		}
		ImageIcon iconFrame = ImageResource.getInstance().createImageIcon("Aktienguru.png", "");
		setIconImage(iconFrame.getImage());
		setTitle(" Aktienguru Chart View");
		
		Container contentPane = getContentPane(); 
		contentPane.removeAll();
		contentPane.setLayout(new BorderLayout());
		
		JPanel masterPane = new JPanel();
		masterPane.setBorder(BorderFactory.createEmptyBorder(-10, -10, -10, -10));
		masterPane.setLayout(new BorderLayout());
		
		ComandBar cbar = new ComandBar();
		cbar.setTitle("Aktienguru Chart View");
		ComandGroup c1 = new ComandGroup(shareName);
		c1.setTabColor(Color.DARK_GRAY);
		ImageIcon icon1 = ImageResource.getInstance().createImageIcon("visualize.png", "");
		c1.setTabIcon(icon1);
		cbar.addComandTab(c1, graph2d.getView2D());
		c1.setSelected(true);
		masterPane.add(cbar, BorderLayout.CENTER);
		
		area = new JTextArea();
		area.setOpaque(false);
		area.setFont(new Font("tahoma", Font.PLAIN, 10));

		getContentPane().add(masterPane, BorderLayout.CENTER);
		setVisible(true);
	}
}
